const { Sequelize, Model } = require('sequelize')
const { sequelize } = require('../../core/db')

class News extends Model {}

News.init({
  id: {
    type: Sequelize.INTEGER,
    autoIncrement: true,
    primaryKey: true
  },
  title: Sequelize.STRING(100),
  type: Sequelize.STRING(20),  
  content: Sequelize.STRING(6000),
  clickCount: {
    type: Sequelize.INTEGER,
    defaultValue: 0
  },
  summary: Sequelize.STRING(500)
}, {
  sequelize
})

module.exports = News